﻿@using InfoTech.VinhSon.Bussiness
@model IEnumerable<InfoTech.VinhSon.Bussiness.Article>
@{
    if (Model.Any())
    {
    <style type="text/css">
        .photo-galerry-today
        {
            margin-bottom: 10px;
            border: 1px solid #ccc;
            padding: 5px;
            width: 240px;
            height: 180px;
            background-color: white;
        }
        .photo-galerry-today a
        {
            display: block;
            float: left;
            line-height: 0;
        }
    </style>
    <script type="text/javascript">
        var topic = 0;
        $(document).ready(function () {
            $('.photo-galerry-today a').css('display', 'none');
            aminationTopicToday();
        });

        function aminationTopicToday() {
            var galerry = $('.photo-galerry-today a');
            if (galerry.length > 0) {
                if (galerry.length > 1)
                    setTimeout(aminationTopicToday, 5000);
                if (topic >= galerry.length)
                    topic = 0;
                if (topic == 0)
                    $(galerry[galerry.length - 1]).css('display', 'none');
                else
                    $(galerry[topic - 1]).css('display', 'none');
                $(galerry[topic]).fadeIn();
                topic++;
            }
        }
    </script>
    <div class="photo-galerry-today shadow-bottom">
        @{
        foreach (Article article in Model)
        {
            <a title="@article.Description" href="@article.GetUrl()">
                <img src="/Resource/Article/@article.Thumbnail" width="240" height="180"/></a>
        }
        }
        <div class="clear">
        </div>
    </div>
    <div class="clear">
    </div>
    }
}
